﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="telephone=no" name="format-detection" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="viewport" content="width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="apple-touch-icon-precomposed" href="/images/apple-touch-icon.png" />
    <title></title>
    <link href="../Styles/reset.css" rel="stylesheet" />
    <link href="../Styles/header.css" rel="stylesheet" />
    <link href="../Styles/foot.css" rel="stylesheet" />
    <link href="../Styles/productdetail.css" rel="stylesheet" />
    <link href="../Styles/themes/default/easyui.css" rel="stylesheet" />
    <link href="../Styles/flexslider.css" rel="stylesheet" />
    <script src="../Javascript/jquery-1.6.2.min.js"></script>
    <script src="../Javascript/jquery.flexslider-min.js"></script>
    <script src="../Javascript/slides.min.jquery.js"></script>
    <script src="../Javascript/jquery.easyui.min.js"></script>
</head>
<body>
    <div class="header" id="header">
        <a class="back" href="javascript:history.back();"></a>
        <span class="headline">酒品详情</span>
        <a class="search" href="/search?r=search"></a>
    </div>
    <section class="sp">
        <div class="product-intro">
            <div id="cont_show">
                <script type="text/javascript">
                    function getQueryString(name) {
                        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                        var r = window.location.search.substr(1).match(reg);
                        if (r != null) return unescape(r[2]); return null;
                    }

                    $(function () {
                        $.ajax({
                            type: "POST",
                            url: "../Services/MarketService.asmx/QueryWineDetail",
                            data: { id: getQueryString("id") },
                            dataType: "json",
                            success: function (data, flag) {
                                if (data.IsSucceed) {
                                    $("#name").html(data.Result.GoodsName);
                                    $("#img").html("<img src=\"" + data.Result.Pictureurl + "\" />");
                                    $("#price").html("活动价&nbsp;&nbsp;&nbsp;<strong>&yen;" + data.Result.CurrentPrice + "</strong>");
                                    $("#marketPrice").html("<strong>&yen;" + data.Result.HistoryPrice + "</strong>");
                                }
                                else {

                                }
                            },
                            error: function (e, d, s) {
                            }
                        });

                        $.ajax({
                            url: "../Services/CommonService.asmx/QueryDeliverRegion",
                            cache: false,
                            success: function (data) {
                                if (data.IsSucceed) {
                                    $('#area').combobox({
                                        valueField: 'RegionID',
                                        textField: 'RegionName'
                                    });
                                    $("#area").combobox("loadData", data.Result);
                                }
                            }
                        });

                        $('.flexslider').flexslider({
                            animation: "slide",
                            slideDirection: "horizontal"
                        });
                    });

                    function Buy() {
                        $.ajax({
                            type: "POST",
                            url: "../Services/CustomerService.asmx/HasLogin",
                            dataType: "json",
                            success: function (data, flag) {
                                if (data.IsSucceed) {
                                    if (data.Result.HasLogin) {
                                        $.ajax({
                                            type: "POST",
                                            url: "../Services/MarketService.asmx/AddToCart",
                                            data: { goodsId: getQueryString("id"), count: parseInt($("#prosum").val()) },
                                            dataType: "json",
                                            success: function (cartData, flag) {
                                                if (cartData.IsSucceed) {
                                                    if (cartData.Result) {
                                                        document.location.href = "Order.html";
                                                    }
                                                } else {
                                                    alert(cartData.ErrorMessage);
                                                }
                                            }
                                        });
                                    }
                                    else {
                                        var newUrl = "../Customer/Login.html?Url=" + document.location.href;
                                        document.location.href = newUrl;
                                    }
                                }
                                else {
                                    alert(data.ErrorMessage);
                                }
                            },
                            error: function (e, d, s) {
                            }
                        });
                    }
                </script>

                <div class="show">
                    <div class="icon">
                        <a class="no-collect" href="javascript:void();" title="" target="" id='collect'></a>
                    </div>
                    <div class="flexslider">
                        <ul class="slides">
                            <li class="on" id="img"></li>
                        </ul>
                    </div>
                </div>
                <div class="pro-info">
                    <p class="pro-name" id="name"></p>
                    <div class="price clearfix">
                        <p class="jx-price" id="price"></p>
                        <p class="market-price" id="marketPrice"></p>
                    </div>
                    <div class="price clearfix">
                        <p class="jx-p">
                            <a href="tel:0355-8888519"><strong>订酒热线  0355-8888519</strong></a>
                        </p>
                        <br />
                        <p class="jx-p">订货时间：全天24小时。非送货时间次日优先送达</p>
                        <br />
                        <p class="jx-p">送货时间：9:00-20:00</p>
                        <br />
                        <p class="jx-p">送货范围：长治市区、郊区</p>
                        <br />
                        <p class="jx-p">免费送货：白酒、红酒一瓶起送</p>
                        <br />
                        <p class="jx-ptab">啤酒、饮料一件起送</p>
                        <br />
                        <p class="jx-ptab">香烟一条起送</p>
                        <br />
                        <p class="jx-p">付款方式：货到付款、网站网银支付</p>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <div class="footer">
    </div>
    <script type="text/javascript">
        function chgNum(a) {
            var prosum = $("#prosum");
            var p = parseInt(prosum.val());
            if (a == 1) {
                if (p < 100) prosum.val(++p);
            }
            else {
                if (p > 1) prosum.val(--p);
            }
        }
    </script>
</body>
</html>
